package com.jy.datapipeline.importserver.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.*;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ImportSubtask implements BasicEntity {

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    private String subtaskId;

    private String taskId;

    private String sqlldrInfoId;

    private String ruleTableId;

    private String fileName;

    private Integer tryCount;

    private Integer trySubtaskLoadCount;

    private Integer trySubtaskLoadInterval;

    private Integer trySubtaskLoadCurrentCount;

    private String subtaskStatus;

    private Date circleTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatetime;

    private String ctlContext;

    private Integer version;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    private String sqlldrUrl;

    private String username;

    private String password;

    private String tnsUrl;

    private String sqlldrParams;

    private String sid;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @SneakyThrows
    @Override
    public BasicEntity createClone() {
        return (BasicEntity) clone();
    }
}